操作表单: 目的: 其实就是为了将表单中表单元素的值,
  存储到状态中,
  便于后面一次性提交给服务器

import React, { Component } from 'react'

export default class Test extends Component {
  state = {
    username: '',
  }
  handle = (e) => {
    this.setState({
      username: e.target.value.trim(),
    })
  }
  render() {
    return (
      <div>
        <input type="text" value={this.state.username} onChange={this.handle} />
      </div>
    )
  }
}
